//
//       _/_/_/                      _/            _/_/_/_/_/
//    _/          _/_/      _/_/    _/  _/              _/      _/_/      _/_/
//   _/  _/_/  _/_/_/_/  _/_/_/_/  _/_/              _/      _/    _/  _/    _/
//  _/    _/  _/        _/        _/  _/          _/        _/    _/  _/    _/
//   _/_/_/    _/_/_/    _/_/_/  _/    _/      _/_/_/_/_/    _/_/      _/_/
//
//
//  Copyright (c) 2015-2016, Geek Zoo Studio
//  http://www.geek-zoo.com
//
//
//  Permission is hereby granted, free of charge, to any person obtaining a
//  copy of this software and associated documentation files (the "Software"),
//  to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense,
//  and/or sell copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
//  IN THE SOFTWARE.
//

package com.example.moshudriver.tools;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Environment;
import android.text.format.Time;

public class O2OMobileAppConst {
	
	public static final String ACTIVITYINDEX="activityindex";
	public static final String ISEMULATOR="isemulator";

	public static final int SIMPLEHUDNAVIE=0;
	public static final int EMULATORNAVI=1;
	public static final int SIMPLEGPSNAVI=2;
	public static final int SIMPLEROUTENAVI=3;


	public static final boolean DAY_MODE=false;
	public static final boolean NIGHT_MODE=true;
	public static final boolean YES_MODE=true;
	public static final boolean NO_MODE=false;
	public static final boolean OPEN_MODE=true;
	public static final boolean CLOSE_MODE=false;
	
	

	public static String FILEPATH = Environment.getExternalStorageDirectory() + "/.moshu/.cache/"+time_picture();
	public static String FILEPATH1 = Environment.getExternalStorageDirectory() + "/.moshu/.cache/"+imageName();

	public static final String MODEL = "model";
	public static final String USERINFO = "user_info";
	public static final String LOCATION_CHARGE = "location_charge";
    public static final int VERSION_CODE = 1;
    public static final String SERVICE_TYPE = "service_type";
    public static final String ORDERINFO = "order_info";
    public static final String USERID = "user_id";
    public static final String SERVICE_TYPE_ID = "service_type_id";
    
    
    public static String time_picture(){
    	Time t=new Time();
    	 t.setToNow();
        int year=t.year;
        int month=t.month;
        int day=t.monthDay;
        int hour=t.hour;
        int minute=t.minute;
        int second=t.second;
//        Log.i(TAG, ""+year+month+day+hour+minute+second);
        String filename=""+year+month+day+hour+minute+second;
        return filename;
    }

	public static String imageName() {
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss");
		Date date = new Date();
		String time = format.format(date);
		String imageName = "IMG_" + time + ".jpg";
		return imageName;
	}

	public static String videoName() {
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss");
		Date date = new Date();
		String time = format.format(date);
		String imageName = "Video_" + time + ".mp4";
		return imageName;
	}
	// 判断网络是否连接
	public static boolean isNetworkConnected(Context context) {
		if (context != null) {
			ConnectivityManager mConnectivityManager = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo mNetworkInfo = mConnectivityManager
					.getActiveNetworkInfo();
			if (mNetworkInfo != null) {
				return mNetworkInfo.isAvailable();
			}
		}
		return false;
	}


}
